package com.nox.trademe.testapp.models;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

public class Subcategory implements Parcelable {

	private String name;
	private String number;
	private String path;
    private String count;
	private ArrayList<Subcategory> subcategories;
	
	public Subcategory(String name, String number, String path, String count, ArrayList<Subcategory> subcategories) {
		super();
		this.name = name;
		this.number = number;
		this.path = path;
        this.count = count;
		this.subcategories = subcategories;
	}

    public Subcategory(Parcel in) {
        this.name = in.readString();
        this.number = in.readString();
        this.path = in.readString();
        this.count = in.readString();
        in.readTypedList(subcategories, Subcategory.CREATOR);
    }

    public static final Parcelable.Creator<Subcategory> CREATOR =
            new Parcelable.Creator<Subcategory>() {
                public Subcategory createFromParcel(Parcel in) {
                    return new Subcategory(in);
                }

                public Subcategory[] newArray(int size) {
                    return new Subcategory[size];
                }
            };

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getNumber() {
		return number;
	}
	
	public void setNumber(String number) {
		this.number = number;
	}
	
	public String getPath() {
		return path;
	}
	
	public void setPath(String path) {
		this.path = path;
	}

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }

    public ArrayList<Subcategory> getSubcategories() {
		return subcategories;
	}
	
	public void setSubcategories(ArrayList<Subcategory> subcategories) {
		this.subcategories = subcategories;
	}

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel destination, int flags) {
        destination.writeString(name);
        destination.writeString(number);
        destination.writeString(path);
        destination.writeString(count);
        destination.writeTypedList(subcategories);
    }
}
